﻿using System;
using System.Linq;
using System.Workflow.Activities;
using DataAccessLayer;

namespace WCFSeviceLibrary
{
    public sealed partial class CustomServiceWorkflow : SequentialWorkflowActivity
    {
        public String ReturnValue = default(String);
        public Int32 Identifier = default(Int32);

        public CustomServiceWorkflow()
        {
            InitializeComponent();
        }

        private void codeActivity1_ExecuteCode(object sender, EventArgs e)
        {
            using (var entities = new BtVisionEntities())
            {
                ReturnValue = entities.Customer.First(x => x.id == Identifier).name;
            }
        }
    }

}
